/**
 * @Title: ShowUserInfoController.java
 * @Package com.zll.ccp.controller
 * @author zhanglinlu
 * @date 2019年5月23日 下午5:53:27
 */
package com.zll.ccp.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zll.ccp.service.IUserInfoService;

/**
 * @ClassName: ShowUserInfoController
 * @Description: 展示用户信息
 * @author zhanglinlu
 * @date 2019年5月23日 下午5:53:27
 * 
 */
@Controller
public class ShowUserInfoController {
    @Autowired
    private IUserInfoService userInfoService;

    /**
     * @Title: showUserInfo
     * @Description: 进入展示用户详情
     * @param id
     * @param request
     * @return
     */
    @RequestMapping("/showuserinfo")
    public String showUserInfo(String name, HttpServletRequest request) {
        request.setAttribute("name", name);
        return "showuser";
    }

    /**
     * @Title: getUserInfoById
     * @Description: 根据名字 查询用户详情
     * @param name
     * @return
     */
    @GetMapping("/userinfobyname")
    @ResponseBody
    public Object getUserInfoById(String name) {
        return userInfoService.getUserInfoByUserName(name);
    }
}
